namespace NAct.Tests.Support
{
	using System;
	using Attributes;
	using NUnit.Framework;
	using NUnit.Framework.SyntaxHelpers;

	public class SimpleMathType
	{
		private int[] numbers;
		private int result;

		[ Given( "the numbers (?<values>[0-9,]+)" ) ]
		public void CollectNumbers( int[] values )
		{
			numbers = values;
		}

		[ When( "the numbers are added together" ) ]
		public void AddNumbers()
		{
			Array.ForEach( numbers, number => result += number );
		}

		[ Then( "the result should be (?<result>[0-9]+)" ) ]
		public void VerifyResult( int result )
		{
			Assert.That( this.result, Is.EqualTo( result ), string.Format( "Result should have been {0}", result ) );
		}

		public void ShouldNotBeUsedByRunner()
		{
			throw new NotImplementedException( "SimpleMathType.ShouldNotBeUsedByRunner" );
		}
	}
}